package com.example.case02_recyclerview229;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.TextView;

public class FoodActivity_229 extends AppCompatActivity {

    private TextView tvn,tvp,tvd,tvt,tvtile;
    private ImageView picture;
    private Button btn1,btn2;
    Context context;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_food_229);
        context=FoodActivity_229.this;
        initViews();
    }

    private void initViews() {
        tvn=findViewById(R.id.textView4);
        tvp=findViewById(R.id.textView5);
        tvd=findViewById(R.id.textView9);
        tvt=findViewById(R.id.textView8);
        tvtile=findViewById(R.id.textView10);
        btn1=findViewById(R.id.button2);
        picture=findViewById(R.id.imageView3);
        Intent intent=getIntent();
        String food_name,food_des,food_tel,food_price,name;
        int img;
        img=intent.getIntExtra("img",R.drawable.food1);
        food_name=intent.getStringExtra("food_title");
        food_des=intent.getStringExtra("food_pl");
        food_tel=intent.getStringExtra("food_tel");
        food_price=intent.getStringExtra("food_price");
        name=intent.getStringExtra("name");
        picture.setImageResource(img);
        tvtile.setText(name);
        tvn.setText(food_name);
        tvp.setText(food_price);
        tvd.setText(food_des);
        tvt.setText(food_tel);
        getIntent().getIntExtra("food_title",-1);
        btn1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

            }
        });
        btn2=findViewById(R.id.button3);
        btn2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                Intent intent=new Intent(FoodActivity_229.this,MainActivity.class);
            }
        });

    }
}
